import com.system.UserPasswordEncoderListener
import grails.plugin.springsecurity.SpringSecurityUtils

// Place your Spring DSL code here
beans = {
    authenticationProcessingFilter(com.system.AuthFilter) {
        def conf = SpringSecurityUtils.securityConfig
        authenticationManager = ref("authenticationManager")
        sessionAuthenticationStrategy = ref('sessionAuthenticationStrategy')
        authenticationSuccessHandler = ref('authenticationSuccessHandler')
        authenticationFailureHandler = ref('authenticationFailureHandler')
        rememberMeServices = ref('rememberMeServices')
        authenticationDetailsSource = ref('authenticationDetailsSource')
        filterProcessesUrl = conf.apf.filterProcessesUrl
        usernameParameter = conf.apf.usernameParameter
        passwordParameter = conf.apf.passwordParameter
        continueChainBeforeSuccessfulAuthentication = conf.apf.continueChainBeforeSuccessfulAuthentication
        allowSessionCreation = conf.apf.allowSessionCreation
        postOnly = conf.apf.postOnly
    }
    userPasswordEncoderListener(UserPasswordEncoderListener)


    userDetailsService(com.system.CustomUserDetailsService){
        grailsApplication = ref('grailsApplication')
    }

}
